import { AnyAction } from 'redux';
import { HomeState } from '../../typings';
import * as actionTypes from '../action-types';

const initialState: HomeState = {
  loading: true,
};
// immer 不可变数据集  redux-immutable  redux-immer
export default function (
  state: HomeState = initialState,
  action: AnyAction,
  setcurrentcategory = actionTypes.SET_CURRENT_CATEGORY,
): HomeState {
  switch (action.type) {
    case setcurrentcategory:
      return { ...state };

    default:
      return state;
  }
}
